import request from '@/utils/request'

// 获取月卡信息列表
export const getCardListApi = (params) => request.get('/parking/card/list', { params })

// 新增月卡
export const getCreateCardApi = (data) => request.post('/parking/card', data)

// 获取月卡详情
export const getCardDetailApi = (id) => request({
  url: `/parking/card/detail/${id}`
})

// 更新编辑月卡
export function getUpdateCardApi(data) {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}
// 删除月卡
export function getDelAllCardApi(ids) {
  return request({
    url: `/parking/card/${ids.join(',')}`,
    method: 'DELETE'
  })
}

// 获取计费规则列表
export function getRuleListApi(params) {
  return request({
    url: '/parking/rule/list',
    params
  })
}
